package weatherwidget.isrefluxer.bird.com.birdweatherwidget.until;

import android.app.ActivityManager;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * Created by Administrator on 2016/11/22.
 */

public class ConnectUtil {
    public static boolean isNetworkConnected(Context context) {
        if (context !=null)
        {
            ConnectivityManager mConnectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo networkinfo = mConnectivityManager.getActiveNetworkInfo();
            if(networkinfo!=null)
            return networkinfo.isAvailable();

        }
        return false;
    }
}
